/*
 * @Author: daiqisheng 3273889106@qq.com
 * @Date: 2022-11-03 14:37:02
 * @LastEditors: daiqisheng 3273889106@qq.com
 * @LastEditTime: 2023-05-05 09:37:01
 * @FilePath: \vite-project\src\request\index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import axios from "axios";

const service = axios.create({
  baseURL:'http://127.0.0.1:8182',
  timeout: 120000,
});
// 请求拦截
service.interceptors.request.use((config) => {
  if(sessionStorage.getItem('token')){
    config.headers['Authorization'] =sessionStorage.getItem('token')
  }
  return config;
});
// 响应拦截
service.interceptors.response.use((res) => {;
  return res;
});

export default service;
